package sort;

import java.util.Arrays;

public class BubbleSort implements BasicMethod {

    @Override
    public void sort(Comparable[] arr) {
        for (int i = 1; i < arr.length; i++) {
            for (int j = 0; j < arr.length - i; j++) {
                if (bigger(arr[j], arr[j + 1])) {
                    swap(arr, j, j + 1);
                }
            }
        }
    }


    public static class test{
        public static void main(String[] args) {
            Integer[] array={4,6,8,7,9,2,10,1};
            new BubbleSort().sort(array);
            System.out.println(Arrays.toString(array));
        }
    }
}
